package com.onewo.arthasdemo;

import com.onewo.arthasdemo.highCPU.RegexLoad;
import com.onewo.arthasdemo.mathGame.MathGame;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.concurrent.TimeUnit;

@SpringBootApplication
public class ArthasDemoApplication implements ApplicationRunner {

	public static void main(String[] args) {
		SpringApplication.run(ArthasDemoApplication.class, args);
	}

	@Override
	public void run(ApplicationArguments args) throws Exception {
		//High CPU
		RegexLoad load = new RegexLoad();
		load.start();

		MathGame game = new MathGame();
		while (true) {
			game.run();
			TimeUnit.SECONDS.sleep(5L);
		}
	}
}
